---@meta

--- LuatOS IDE Helper for module: fonts
--- ```yaml
--- Summary: 字体库
--- URL: https://gitee.com/openLuat/LuatOS/tree/master/luat/../components/luatfonts/luat_lib_fonts.c
--- Demo: 
--- Video: 
--- Tag: LUAT_USE_FONTS
--- ```
fonts = {}

--- 返回固件支持的字体列表
---@param tp string 类型, 默认 u8g2, 还可以是lvgl
---@return table #1 字体列表
--- ```lua
--- API新增于2022-07-12
--- if fonts.list then
---     log.info("fonts", "u8g2", json.encode(fonts.list("u8g2")))
--- end
--- ```
function fonts.list(tp) end

--- 获取字体
---@param name string 字体名称, 例如opposansm8_chinese unifont_t_symbols
---@param tp string 类型, 默认 u8g2, 还可以是lvgl
---@return userdata #1 若字体存放,返回字体指针, 否则返回nil
--- ```lua
--- oppo_8 = fonts.get("opposansm8_chinese", "u8g2")
--- if oppo_8 then
---     u8g2.SetFont(oppo_8)
--- else
---     log.warn("fonts", "no such font opposansm8_chinese")
--- end
--- 若使用云编译的自定义字库, 使用方式如下
--- oppo_8 = fonts.get("oppo_bold_8", "u8g2") -- oppo_bold_8 是云编译界面的字库命名
--- if oppo_8 then
---     u8g2.SetFont(oppo_8)
--- else
---     log.warn("fonts", "no such font opposansm8_chinese")
--- end
--- ```
function fonts.u8g2_get(name, tp) end

--- 从文件加载字体
---@param path string 字体路径, 例如 /luadb/abc.bin
---@param path string 类型, 默认 u8g2. 也支持lvgl
---@return userdata #1 若字体存放,返回字体指针, 否则返回nil
--- ```lua
--- API新增于2022-07-11
--- 提醒: 若文件位于/luadb下, 不需要占用内存
--- 若文件处于其他路径, 例如tf/sd卡, spi flash, 会自动加载到内存, 消耗lua vm的内存空间
--- 加载后请适当引用, 不必反复加载同一个字体文件
--- oppo12 = fonts.load("/luadb/oppo12.bin")
--- if oppo12 then
---     u8g2.SetFont(oppo12)
--- else
---     log.warn("fonts", "no such font file oppo12.bin")
--- end
--- ```
function fonts.u8g2_load(path, path) end
